package org.origin.ferret.system.model.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.origin.centre.model.enums.XDisplay;
import org.origin.centre.model.enums.XUsable;
import org.origin.centre.support.base.annotations.XMapper;
import org.origin.ferret.center.model.base.BasicEntity;
import org.origin.ferret.system.model.enums.MenuTypeEnum;

/**
 * 系统菜单-实体类
 *
 * @author ferret
 * @version 2024-05-08
 */
@Data
@Accessors(chain = true)
@Table("sys_menu")
@Schema(description = "系统菜单-实体类")
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class SysMenuEntity extends BasicEntity {

    @Id(keyType = KeyType.Auto)
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "上级")
    private Long parentId;

    @Schema(description = "编号（所有父级编号）")
    private String parentIds;

    @XMapper(MenuTypeEnum.class)
    @Schema(description = "类型")
    private Integer type;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "路径")
    private String path;

    @Schema(description = "权限")
    private String permit;

    @Schema(description = "组件")
    private String component;

    @XMapper(XDisplay.class)
    @Schema(description = "显示")
    private Integer display;

    @XMapper(XUsable.class)
    @Schema(description = "状态")
    private Integer status;

    @Schema(description = "顺序")
    private Integer sort;
}
